package file.day9_23;

import fristphase.day9_22.T;

public class StaticSyncDemo2 {
    public static void main(String[] args) {
        Boo boo = new Boo();

        Thread t1 = new Thread(){
            public void run(){
                boo.doSome();
            }
        };
        Thread t2 = new Thread(){
            public void run(){
                boo.doSome();
            }
        };

        t1.start();
        t2.start();

    }
}
class Boo{
    public static void doSome(){
        Thread t = Thread.currentThread();
        synchronized (Boo.class){
            System.out.println(t.getName() + "正在执行doSome");
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(t.getName() + "执行doSome完毕");
        }

    }
}
